#ifndef __VVIEW_VOBJECTTEST_H__
#define __VVIEW_VOBJECTTEST_H__

#include "../VView/common/vObject.h"
#include "../VView/common/vDebugUtils.h"
using namespace vview;

WINX_SIMPLE_TEST(TestVObject)
{
	CRuntimeInfo* pRTInfo = RUNTIMEINFO(CVObject);
	AssertExp(strcmp(pRTInfo->szClassName, "CVObject") == 0);
	AssertExp(pRTInfo->pBaseRTInfo == NULL);
}

class CVDerivedObject: public CVObject
{
	DECLARE_RUNTIMEINFO(CVDerivedObject)
};
IMPLEMENT_RUNTIMEINFO(CVDerivedObject, CVObject)

class CVDerivedObject2: public CVObject
{
	DECLARE_RUNTIMEINFO(CVDerivedObject2)
};
IMPLEMENT_RUNTIMEINFO(CVDerivedObject2, CVObject)

WINX_SIMPLE_TEST(TestVDerivedObject)
{
	AssertExp(CLASS_DERIVEDFROM(CVDerivedObject, CVObject));

	CVDerivedObject vdobj;
	AssertExp(OBJECT_DERIVEDFROM(&vdobj, CVObject));
	AssertExp(!OBJECT_ISCLASS(&vdobj, CVObject));

	CVObject* pvObj = &vdobj;

	CVDerivedObject* pvdobj = OBJECT_ASCLASS(pvObj, CVDerivedObject);
	AssertExp(pvdobj != NULL);

	CVDerivedObject2* pvdobj2 = OBJECT_ASCLASS(pvObj, CVDerivedObject2);
	AssertExp(pvdobj2 == NULL);
}

#endif // __VVIEW_VOBJECTTEST_H__